<?php


class Uniform_Factory_Abstract
{
	var $service;
	var $ns;
	var $default_type='Abstract';

	public function __construct ($service, $ns)
	{
		$this->service = $service;
		$this->ns = $ns;
	} // end of __construct

	public function getUniform ($what, $type=NULL)
	{
		if (!$type) $type = $this->default_uniform;

		$class = "{$this->ns}{$type}";
		if ($this->service->useClass($class)) {
			$o = new $class($this->service, $what);
		} else {
			$o = false;
		}
		return $o;
	} // end of method getUniform
}

